﻿#pragma once
#include <stdint.h>
#include <vector>
using namespace std;
// 道具
struct IdValuePair
{
	IdValuePair() : iId(0), iValue(0) {}
	IdValuePair(uint32_t id, uint32_t value) : iId(id), iValue(value) {}

	uint32_t iId;
	union
	{
		uint32_t iValue;
		uint32_t iNum;
	};

	bool operator==(const IdValuePair& stIdValuePair) const
	{
		return iId == stIdValuePair.iId && iValue == stIdValuePair.iValue;
	}

	bool operator<(const IdValuePair& stIdValuePair) const
	{
		if (iId == stIdValuePair.iId)
		{
			return iValue < stIdValuePair.iValue;
		}
		else
		{
			return iId < stIdValuePair.iId;
		}
	}
};
typedef vector<IdValuePair> IdValueVec;

typedef IdValuePair IdNumPair;
typedef vector<IdNumPair> IdNumVec;

typedef IdNumPair ItemKey;
typedef vector<ItemKey> ItemKeyVec;

// 英雄
struct HeroKey
{
	HeroKey() : iId(0), iNum(0), iLevel(0) {}
	HeroKey(uint32_t id, uint32_t num, uint32_t level) : iId(id), iNum(num), iLevel(level) {}

	uint32_t iId;
	uint32_t iNum;
	uint32_t iLevel;

	bool operator==(const HeroKey& stHeroKey) const
	{
		return iId == stHeroKey.iId && iNum == stHeroKey.iNum && iLevel == stHeroKey.iLevel;
	}

	bool operator<(const HeroKey& stHeroKey) const
	{
		if (iId == stHeroKey.iId)
		{
			if (iNum == stHeroKey.iNum)
			{
				return iLevel < stHeroKey.iLevel;
			}
			else
			{
				return iNum < stHeroKey.iNum;
			}
		}
		else
		{
			return iId < stHeroKey.iId;
		}
	}
};
typedef vector<HeroKey> HeroKeyVec;